<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    #a {
      width: 300px;
      height: 300px;
      background: #f00;
    }

    #b {
      width: 200px;
      height: 200px;
      background: #0f0;
    }

    #c {
      width: 100px;
      height: 100px;
      background: #00f;
    }
  </style>
</head>

<body>
  <div id="a">a
    <div id="b">b
      <div id="c">c</div>
    </div>
  </div>
  <script>

    var oA = document.getElementById('a');
    var oB = document.getElementById('b');
    var oC = document.getElementById('c');

    oA.addEventListener('click', function (e) {
      console.log('a...', e.target);
      // console.log(e.target);
    }, false)
    oB.addEventListener('click', function (e) {
      console.log('b...', e.target);
      // console.log(e.target);
    }, false)
    oC.addEventListener('click', function (e) {
      e.stopPropagation();//阻止事件冒泡
      console.log('c...');
    }, false)

    /*
      事件冒泡：当点击子元素的时候，父元素的事件也被触发
    */


  </script>
</body>

</html>